﻿CREATE TABLE [dbo].[OrderedPizzaInfo]
(
	[OrderInfoID] INT NOT NULL ,
	[PizzaIndex] INT NOT NULL, 
    [Size] INT NOT NULL, 
    [Price] INT NOT NULL, 
    [PizzaTemplateID] INT NULL, 
    CONSTRAINT [FK_OrderedPizzaInfo_OrderInfoID] FOREIGN KEY ([OrderInfoID]) REFERENCES [dbo].[OrderInfo] ([ID]),
	CONSTRAINT [FK_OrderedPizzaInfo_PizzaTemplateID] FOREIGN KEY ([PizzaTemplateID]) REFERENCES [dbo].[PizzaTemplate] ([ID]),
	PRIMARY KEY (OrderInfoID, PizzaIndex)
)
